package com.zjq.designpatterns.behaviors.observer.code;/*
 * 版权信息: 北京千⾥马网信科技有限公司</br>
 * Copyright ©2008-2018. All rights reserved. 京ICP备16007318号
 */

/**
 * @author jessie
 * @version 1.0
 * @date 2021/1/27
 */
public class Test {
    public static void main(String[] args) {
        Course course = new Course("java设计模式精讲");
        Teacher teacher1 = new Teacher("Alpha");
        Teacher teacher2 = new Teacher("Beta");
        //teacher观察
        course.addObserver(teacher1);
        course.addObserver(teacher2);

        //业务逻辑代码
        Question question = new Question();
        question.setUserName("Geely");
        question.setQuestionContent("java的主函数如何编写");

        course.produceQuestion(course, question);
    }
}
